package com.idanchuang.support.etcache;

import java.util.concurrent.TimeUnit;

/**
 * @author yjy
 * Created at 2022/3/28 5:13 下午
 */
public class EtCacheProperties {

    /** 是否开启 etCache 功能 */
    private boolean enabled = true;
    /** 是否开启集成 SpringCache */
    private boolean springCacheEnabled = false;
    /** 事件机制， redis(pubsub) 、 amqp */
    private String eventType = "redis";
    /**
     * 缓存最长过期时间
     */
    private int maxExpire = -1;
    /**
     * 过期时间单位
     */
    private TimeUnit expireUnit = TimeUnit.SECONDS;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public int getMaxExpire() {
        return maxExpire;
    }

    public void setMaxExpire(int maxExpire) {
        this.maxExpire = maxExpire;
    }

    public boolean isSpringCacheEnabled() {
        return springCacheEnabled;
    }

    public void setSpringCacheEnabled(boolean springCacheEnabled) {
        this.springCacheEnabled = springCacheEnabled;
    }

    public TimeUnit getExpireUnit() {
        return expireUnit;
    }

    public void setExpireUnit(TimeUnit expireUnit) {
        this.expireUnit = expireUnit;
    }
}
